-
Notifications
You must be signed in to change notification settings - Fork 764
Deleting a user modal won't close and page won't redirect #6560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,33 @@ | |
}); | ||
} | ||
|
||
function handleAccountDeletion() { | ||
// Handle the delete account button click | ||
$('#delete-profile-button').on('click', function(e) { | ||
e.preventDefault(); | ||
|
||
var $form = $(this).closest('form'); | ||
|
||
// Close modals - keep both systems for compatibility | ||
if (typeof Mzp !== 'undefined' && Mzp.Modal) { | ||
Mzp.Modal.closeModal(); | ||
} | ||
|
||
if ($.kbox) { | ||
$.kbox.close(); | ||
} | ||
|
||
// Directly submit the form after a small delay | ||
// This ensures the modal closing completes before submission | ||
setTimeout(function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using a hardcoded delay of 50ms might be brittle if modal closing is slower than expected. Consider implementing a callback from the modal closing process or extracting the delay into a clearly named constant for easier adjustments. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
$form[0].submit(); | ||
}, 50); | ||
}); | ||
} | ||
|
||
$(function() { | ||
makeEmailsClickable(); | ||
confirmUserDeactivation(); | ||
handleAccountDeletion(); | ||
}); | ||
})(jQuery); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider verifying the existence of$.kbox using a typeof check (e.g. typeof $ .kbox !== 'undefined') for consistency with the check for Mzp.Modal to avoid potential run-time errors.
Copilot uses AI. Check for mistakes.